#ifndef STRING_H
#define STRING_H

# ifdef __cplusplus
extern "C" {
# endif

typedef struct String_s {
    int     length;     // data's length
    int     allocSize;  // Acturally memory alloc size, allocSize > length
    char*   data;       // string
} String_t;

String_t* String_new();
void      String_append(String_t* string, const char* data);
int       String_appends(String_t* string, const char* format, ...);
void      String_increase(String_t* string);
void      String_clear(String_t* string);
void      String_free(String_t* string);

# ifdef __cplusplus
}
# endif

#endif // STRING_H
